const teachers = [
  {
    id: 'T026454',
    name: '张胜男',
    college: '物理与信息学院',
    title: '教授',
    password: '123456'
  },
  {
    id: 'T055478',
    name: '李贤',
    college: '计算机与大数据学院',
    title: '副教授',
    password: '123456'
  },
  {
    id: 'T025687',
    name: '张怀民',
    college: '物理与信息学院',
    title: '讲师',
    password: '123456'
  }
]

export default [
  //admin get teacher list
  // {
  //   url: '/admin/teacher/list',
  //   type: 'post',
  //   response: config => {
  //     return {
  //       teachers: teachers
  //     }
  //   }
  // },
  //admin change teacher list
  // {
  //   url: '/admin/teacher/update',
  //   type: 'post',
  //   response:config => {
  //     const {t_id, new_name, new_password, new_college, new_title} = config.body
  //     console.log(t_id + new_name + new_password + new_college + new_title)
  //     for(var i = 0; i < teachers.length; i++) {
  //       if(teachers[i].id == t_id) {
  //         teachers[i].name = new_name
  //         teachers[i].password = new_password
  //         teachers[i].college = new_college
  //         teachers[i].title = new_title
  //       }
  //     }
  //     return {
  //       code: 200
  //     }
  //   }
  // },
  //admin delete teacher
  // {
  //   url: '/admin/teacher/delet',
  //   type: 'post',
  //   response: config => {
  //     const { t_id } = config.body
  //     console.log(t_id)
  //     for(var i = 0;i < teachers.length; i++) {
  //       if(teachers[i].id == t_id) {
  //         teachers.splice(i, 1)
  //         break
  //       }
  //     }
  //     return {
  //       code: 200
  //     }
  //   }
  // },
  //admin add teacher
  // {
  //   url: '/admin/teacher/add',
  //   type: 'post',
  //   response: config => {
  //     const { t_name, t_password, t_college, t_title } = config.body
  //     var newTeacher = {
  //       id: 'T0' + Math.floor(Math.random()*100000 + 1),
  //       name: t_name,
  //       college: t_college,
  //       title: t_title,
  //       password: t_password
  //     }
  //     teachers.push(newTeacher)
  //     return {
  //       code: 200
  //     }
  //   }
  // }
]
